﻿/***************************************************************************
 * 文件名：CardVerificationMgr
 * 功能：
 * 说明：
 * -------------------------------------------------------------------------
 * 创建时间：2024/5/29 14:26:06
 * 创建人：金文旭
 * 邮箱： ohayashi@163.com
 * =========================================================================
 *
 * 修改人：   
 * 修改时间：   
 * 修改说明：   
 ***************************************************************************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CardVerification.NewPlan
{
    /// <summary>
    /// 对一系列接口设计服务类,可以有效统合有类似用途的接口,同时也可以对接口的生命期进行管理
    /// </summary>
    public static class CardVerificationMgr
    {
        private static ICardVerificationService cardVerificationService;
        private static object _lock=new object();
        public static CardVerifiMessage DoCardVerifi(string cardNo, string cerfiId, string customerNm)
        {
            ICardVerificationService service = GetService();
            return service.DoCardVerification(cardNo, cerfiId, customerNm);
        }
        public static ICardVerificationService GetService()
        {
            if (cardVerificationService == null)
            {
                lock (_lock)
                {
                    cardVerificationService = new CardVerificationService();
                }
            }
            return cardVerificationService;

        }
    }
}
